export interface userProps { // user type
  id?: number;
  rid?: number;
  username?: string;
  mobile?: string;
  email?: string;
  state: boolean;
  token?: string;
}
export interface productListProps { // productList type
  add_time?: number;
  goods_id?: number;
  goods_name?: string;
  goods_number?: number;
  goods_price?: number;
  goods_weight?: number;
  upd_time?: number;
}
export interface productDataProps { // productData type
  goods?: productListProps[],
  pagenum: number;
  total: number;
}
export interface menuData { // menuData type
  authName?: string;
  children?: null;
  id?: string;
  order?: number;
  path?: string;
}
export interface AttrsList { // attrsList type
  attr_id?: number;
  attr_name?: string;
  attr_sel?: string;
  attr_vals?: string;
  attr_value?: string;
  attr_write?: string;

}
export interface PiceListProps { // piceList  type
  pics_big?: string;
  pics_id?: number;
  pics_mid?: string;
  pics_sma?: string;
  pic?: string;
}
export interface attrValsProps { // attrVals type
  attr_id?: number;
  attr_name?: string;
  attr_sel?: string;
  attr_vals?: string[] | string;
  attr_write?: string;
  cat_id?: number;
  inputVisible?: boolean;
  inputValue?: string;

}
export interface ProductListRedactProps { // redact type
  goods_cat?: string;
  goods_id?: number;
  goods_introduce?: string;
  goods_name?: string;
  goods_number?: number;
  goods_price?: number;
  goods_state?: number;
  goods_weight?: number;
  attr_vals?: attrValsProps[];
  attrs?: AttrsList[];
  pics?: PiceListProps[];
}
export interface menuListProps<T> {
  id?: number,
  authName?: string,
  path?: null,
  children?: T[]
}
export interface categoriesObjProps { // categoriesObj type
  many: attrValsProps[];
  only: attrValsProps[];
}
export interface pageResultData { // page
  cat_deleted?: boolean;
  cat_id?: number;
  cat_level?: number;
  cat_name?: string;
  cat_pid?: number;
  children?: pageResultData[]
}
export interface categoriesPageObjProps { // pageobj
  pagenum?: number;
  pagesize?: number;
  result?: pageResultData[];
  total?: number;

}

export interface ordersListType {
  order_id?: number;
  user_id?: number;
  order_number?: string;
  order_price?: number;
  order_pay?: string;
  is_send?: string;
  pay_status?: string;
  create_time?: number;
  update_time?: number;
}
export interface timelineDataType {
  time?: string;
  ftime?: string;
  context?: string;
  location?: string;
}

export interface ordersObjType {
  total?: number;
  pageName?: number;
  orders: ordersListType[];
}

export interface redactProductType {
  redactData: ProductListRedactProps;
}

export interface productListModuleType {
  productData: productDataProps;
}
export interface ProductListAndRedactType extends productListModuleType {
  redactModule: redactProductType;
}

export interface ordersModuleType {
  ordersObj: ordersObjType,
  expressData: timelineDataType[];
}

export interface categorieParamsModuleType {
  categoriesList: any[];
  categoriesObj: categoriesObjProps;
}

export interface categoriesModuleType {
  categoriesPageObj: categoriesPageObjProps;
}

export interface RolesTypeInterface {
  id?: number;
  authName?: string;
  path?: null;
  disabled?: boolean;
  children?: RolesTypeInterface[];
}
export interface tagsDataType extends RolesTypeInterface {
  roleDesc?: string;
}
export interface RolesTerrInterfaceType {
  id?: number;
  authName?: string;
  path?: null;
  pid?: number;
  children?: RolesTerrInterfaceType[];
}
export interface rightsListType {
  id?: string;
  authName?: string;
  level?: number;
  pid?: string;
  path?: string;
}
export interface rightsModuleTypeInterface {
  rolesData: { [key: number]: RolesTypeInterface };
  treeData: RolesTerrInterfaceType[];
  tagsData: { [key: number]: tagsDataType };
  rightsList: rightsListType[]
}

export interface userListType {
  id?: number;
  role_name?: string;
  username?: string;
  create_time?: string;
  update_time?: string;
  mobile?: string;
  email?: string;
  mg_state?: boolean;
}
export interface usersType {
  [id: number]: userListType
}
export interface usersDataType {
  total: number;
  pageNum: number;
  users: usersType;
}

export interface usersModuleTypeInterface {
  usersData: usersDataType,
  rolesData: { [key: number]: RolesTypeInterface };
}

export interface GlobalDataProps { // store type
  user: userProps;
  menuList: menuListProps<menuData>[];
}

export interface AllStateType extends GlobalDataProps {
  productList: ProductListAndRedactType;
  paramsModule: categorieParamsModuleType;
  categoriesModule: categoriesModuleType;
  ordersModule: ordersModuleType;
  rightsModule: rightsModuleTypeInterface;
  usersModule: usersModuleTypeInterface;
}